#include "Protocol_IP.h"

CProtocol_IP::CProtocol_IP(void)
{
	name = "IP";
}

CProtocol_IP::~CProtocol_IP(void)
{
}

StackUtils::e_Status CProtocol_IP::Decode( CPacket& packet )
{
	packet.removeElements(0, name.size() + 2);
	packet.removeElements(packet.getBufferContent().size() - (name.size() + 2), name.size() + 2);
	return StackUtils::E_SUCCESS;
}

StackUtils::e_Status CProtocol_IP::Encode( CPacket& packet )
{
	packet.addFront("[IP]");
	packet.addBack("[IP]");
	return StackUtils::E_SUCCESS;
}
